home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / print / hpgl2ps.zip / RECTANGL.C < prev    next >
C/C++ Source or Header  |  1989-08-08  |  711b  |  31 lines

  1. /* rectangle.c */
  2. #include "defn.h"
  3.  
  4. rectangle()
  5. {
  6.     int        hatch;
  7.     float    width, height;
  8.     float    hatch_spacing;
  9.     float    hatch_angle;
  10.     
  11.     if (SIGNED_NUMERIC)
  12.     hatch = getval();
  13.     if (SIGNED_NUMERIC)
  14.     width = getval() * XSCALE;
  15.     if (SIGNED_NUMERIC)
  16.     height = getval() * YSCALE;
  17.     if (SIGNED_NUMERIC)
  18.     hatch_spacing = getval() * XSCALE;
  19.     if (SIGNED_NUMERIC)
  20.     hatch_angle = getval();
  21.  
  22.     end_draw();
  23.     printf("%g %g M\n", xval, yval);
  24.     printf("%g 0 I\n", width);
  25.     printf("0 %g I\n", height);
  26.     printf("-%g 0 I\n", width);
  27.     printf("closepath stroke\n");
  28.     if (hatch != 2)
  29.         fprintf(stderr, "Warning: Cross hatching not implemented yet\n");
  30. }
  31.